(1) Field of the Invention
The present invention relates to a coding apparatus which codes data regarding moving pictures (video) and a decoding apparatus which decodes such coded data, and more particularly to a CABAC coding apparatus and a CABAC decoding apparatus.
(2) Description of the Related Art
With development of digital technologies, technologies for coding video have been also progressed and developed. However, video data (especially moving picture data) has a large amount of data. Therefore, when coded digital video data is transmitted as a broadcast or via a medium such as a DVD, the transmitted video data is very large in size. Particularly, video transmitted in high-definition (HD) broadcasting, which has recently been put to practical use, requires six times the amount of data of conventional standard-definition (SD) video.
With the development of digital imaging technologies, data compression technologies have been utilized and developed for digital video data, in order to address increases in the data amount. One example is the development in a data compression technique specialized for video data, which takes advantage of the characteristics of such video data. Moreover, recent improvements in the data processing ability of computers allow complicated computations in compression technologies, so that compression rates of video data have been significantly enhanced. For example, the MPEG-2 standard is one of such compression technologies, and is employed in satellite and terrestrial digital HD broadcasting.
A further developed video compression technology is the AVC/H.264 standard. The AVC/H.264 standard can achieve an increase in compression rate which is about twice as high as the rate of the MPEG-2 standard. The AVC/H.264 standard employs and combines various compression technologies to realize such a high compression rate. As a result, the amount of computations is also increased significantly.
One of the compression technologies employed in the AVC/H.264 standard is entropy coding (variable-length coding). The entropy coding has two different modes: Context-based Adaptive Variable Length Coding (CAVLC); and Context-based Adaptive Binary Arithmetic Coding (CABAC). In the CAVLC mode, when a DCT coefficient is coded, a Run symbol representing a length of a sequence of consecutive 0s and a Level symbol representing a non-zero value immediately following a sequence of 0s are respectively coded in the direction opposite to the scanning direction, referring to respective variable length coding tables.
CABAC is a mode of coding data to be coded by adaptively changing the occurrence probability of the data which varies with time. Such a method is generally called arithmetic coding (see, for example, Japanese Laid-Open Patent Application No. 2004-135251). In CABAC, in addition to such typical arithmetic coding, another technique is used to assign a context to each code to be compressed and change the occurrence probability for each context.
CABAC includes two main processes. The first process is to convert multivalued (non-binary) data to be coded into binary data, which is called binarization. More specifically, “multivalued data to be coded” denotes macroblock information, DCT coefficients, motion vectors, and the like, which are collectively called a syntax. The second process is to calculate a context of the binary data obtained through binarization of the multivalued data and then to apply arithmetic coding to the binary data according to the calculated context.
Generally, binarization is performed for each macroblock of sixteen by sixteen (16×16) pixels, which is the fundamental unit for coding. Therefore, the amount of binary data fluctuates depending on the number of bits of a code value to which DCT and quantization have been applied. On the other hand, since the arithmetic coding process is performed bit by bit, the operation speed is normally one bit per clock.
Therefore, in the case where the amount of binary data varies significantly from macroblock to macroblock, for example, where a lot of binary data concentrates at the end of a slice which is the unit for coding, such binary data cannot be handled in the arithmetic coding process, and thus overflowed. So, a buffer called a bin buffer for temporarily storing binary data is provided between the binarization circuit and the arithmetic coding circuit. By storing binary data in this bin buffer, it becomes possible to avoid a problem of overflow of binary data in the arithmetic coding process, even if the amount of binary data varies significantly from macroblock to macroblock.
FIG. 1 is a diagram which shows a structure of a conventional coding circuit using CABAC. A quantized DCT coefficient is converted to binary data by a DCT coefficient binarization unit 2. This binary data is temporarily stored in a bin buffer 3, and then coded bit by bit by an arithmetic coding unit 4 and then outputted.
FIG. 2 is a diagram which shows a structure of a conventional decoding circuit using CABAC.
The arithmetic-coded DCT coefficient is converted into binary data through bit-by-bit decoding by an arithmetic decoding unit 5. This binary data is temporarily stored in the bin buffer 3, and then converted into a multivalued quantized DCT coefficient by a DCT coefficient conversion unit 6.
Above-mentioned coding and decoding processes are performed not only on DCT coefficients but also on other syntax elements (such as motion vectors and macroblock information) in the same manner.
In CABAC, UEGk (Concatenated unary/k-th order Exp-Golomb) coding is used as a binarization method. UEGk is a concatenation of truncated unary (TU) coding and Exp-Golomb coding. For example, in the case where a DCT coefficient coeff_abs_level_minus1 (value: x) is binarized using UEGk coding, x is binarized by TU (cMax=14) when x is a value less than 14. On the other hand, when x is a 14 or larger value, x−14 is binarized by exp_Golomb coding and concatenated to the end of a bit string “11111111111111”.
The bit length of binary data is 15 bits when x is 14, 17 bits when x is 15, and 19 bits when x is 17, respectively. The bit length of binary data increases as the value of x becomes larger. Binarization of the largest value of x (where x is 17-bit data) results in the 49-bit length binary data.
As mentioned above, binary data is temporarily stored in the bin buffer 3. However, if DCT coefficients of large values appear consecutively, binary data of long bit length has to be written one after another into the bin buffer 3. In other words, if DCT coefficients of large values appear consecutively, the data transmission rate into the bin buffer 3 becomes high, and therefore a bin buffer with wider bandwidth needs to be provided.
For example, in the case where high-definition video frames each of 1920×1088 pixels are coded at the rate of 30 frames per second, time required for coding one macroblock (16×16 pixels) is 1÷(8160×30)≈4.08 μs. And if DCT coefficients of large values appear consecutively in this macroblock and the binary data of the macroblock has 8,000 bits, the data transmission rate is 1.96 Gbps.
As described above, the conventional structure has a problem that the data transmission rate into the bin buffer 3 becomes significantly high if DCT coefficients of large values appear consecutively. This problem arises not only in the coding apparatus but also in the decoding apparatus.